package com.xc.service;

import com.github.pagehelper.PageInfo;
import com.xc.common.ServerResponse;
import com.xc.pojo.UserRecharge;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;

/**
 * @author mipha
 * @version 1.0
 * @date 2019/2/16 3:05 PM
 */
public interface IUserRechargeService {


    //  入金频控，一小时内只能下 x 条订单 （等待支付订单）
    ServerResponse checkInMoney(int maxOrder,Integer userId);

    ServerResponse inMoney(String amt,String payType,HttpServletRequest request);

    ServerResponse findUserRechargeByOrderSn(String orderSn);


    /**
     *      确认订单成功
     *      修改订单的信息，并修改资金
      */
    ServerResponse chargeSuccess(UserRecharge userRecharge) throws Exception;
    //  充值订单失败
    ServerResponse chargeFail(UserRecharge userRecharge) throws Exception;
    //  取消充值订单
    ServerResponse chargeCancel(UserRecharge userRecharge) throws Exception;


    /**
     *  用户充值记录
     * @param payChannel
     * @param orderStatus
     * @param request
     * @param pageNum
     * @param pageSize
     * @return
     */
    ServerResponse<PageInfo> findUserChargeList(String payChannel, String orderStatus
            , HttpServletRequest request, int pageNum, int pageSize);


    /**
     *      代理后台
     */
    //  查询用户充值记录
    ServerResponse<PageInfo> listByAgent(Integer agentId,String realName,String payChannel,Integer state
            ,HttpServletRequest request,int pageNum,int pageSize);



    /**
     *      管理后台
      */
    ServerResponse listByAdmin(Integer agentId,Integer userId,String realName
            ,Integer state,String beginTime,String endTime
            ,HttpServletRequest request,int pageNum,int pageSize);
    ServerResponse updateState(Integer chargeId,Integer state) throws Exception;
    ServerResponse createOrder(Integer userId,Integer state,Integer amt);

    ServerResponse del(Integer cId);



    BigDecimal CountChargeSumAmt(Integer chargeState);



}
